home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / addflo / data1.cab / Program_Executable_Files / AddFlow / Samples / Editor / itemprop.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-05-06  |  18.5 KB  |  576 lines

  1. VERSION 4.00
  2. Begin VB.Form ItemProp 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Properties"
  5.    ClientHeight    =   5625
  6.    ClientLeft      =   1425
  7.    ClientTop       =   870
  8.    ClientWidth     =   6210
  9.    Height          =   6030
  10.    Left            =   1365
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   5625
  15.    ScaleWidth      =   6210
  16.    ShowInTaskbar   =   0   'False
  17.    Top             =   525
  18.    Width           =   6330
  19.    Begin VB.CheckBox CheckMarked 
  20.       Alignment       =   1  'Right Justify
  21.       Caption         =   "Marked"
  22.       Height          =   255
  23.       Left            =   4440
  24.       TabIndex        =   35
  25.       Top             =   2880
  26.       Width           =   1635
  27.    End
  28.    Begin VB.CheckBox CheckRigid 
  29.       Alignment       =   1  'Right Justify
  30.       Caption         =   "Rigid Link"
  31.       Height          =   255
  32.       Left            =   4440
  33.       TabIndex        =   34
  34.       Top             =   2580
  35.       Width           =   1635
  36.    End
  37.    Begin VB.ComboBox ComboArrowOrg 
  38.       Height          =   315
  39.       ItemData        =   "itemprop.frx":0000
  40.       Left            =   1530
  41.       List            =   "itemprop.frx":001F
  42.       Style           =   2  'Dropdown List
  43.       TabIndex        =   30
  44.       Top             =   1860
  45.       Width           =   2415
  46.    End
  47.    Begin VB.ComboBox ComboArrowDst 
  48.       Height          =   315
  49.       ItemData        =   "itemprop.frx":00CD
  50.       Left            =   1530
  51.       List            =   "itemprop.frx":00EC
  52.       Style           =   2  'Dropdown List
  53.       TabIndex        =   29
  54.       Top             =   2220
  55.       Width           =   2415
  56.    End
  57.    Begin VB.ComboBox ComboLinkStyle 
  58.       Height          =   315
  59.       ItemData        =   "itemprop.frx":019A
  60.       Left            =   1530
  61.       List            =   "itemprop.frx":01A4
  62.       Style           =   2  'Dropdown List
  63.       TabIndex        =   28
  64.       Top             =   2580
  65.       Width           =   2415
  66.    End
  67.    Begin VB.TextBox TextDrawWidth 
  68.       Height          =   315
  69.       Left            =   1530
  70.       TabIndex        =   3
  71.       Top             =   3330
  72.       Width           =   525
  73.    End
  74.    Begin VB.CommandButton CommandFont 
  75.       Caption         =   "Font..."
  76.       Height          =   375
  77.       Left            =   180
  78.       TabIndex        =   7
  79.       Top             =   5160
  80.       Width           =   675
  81.    End
  82.    Begin VB.Frame FrameUserData 
  83.       Caption         =   "User Data"
  84.       Height          =   2055
  85.       Left            =   3030
  86.       TabIndex        =   18
  87.       Top             =   3480
  88.       Width           =   3015
  89.       Begin VB.TextBox Text3 
  90.          Height          =   285
  91.          Left            =   1080
  92.          TabIndex        =   12
  93.          Top             =   1650
  94.          Width           =   1065
  95.       End
  96.       Begin VB.TextBox Text1 
  97.          Height          =   555
  98.          Left            =   570
  99.          MultiLine       =   -1  'True
  100.          ScrollBars      =   2  'Vertical
  101.          TabIndex        =   10
  102.          Top             =   300
  103.          Width           =   2325
  104.       End
  105.       Begin VB.TextBox Text2 
  106.          Height          =   555
  107.          Left            =   570
  108.          MultiLine       =   -1  'True
  109.          ScrollBars      =   2  'Vertical
  110.          TabIndex        =   11
  111.          Top             =   960
  112.          Width           =   2325
  113.       End
  114.       Begin VB.Label Label8 
  115.          Alignment       =   1  'Right Justify
  116.          AutoSize        =   -1  'True
  117.          Caption         =   "User Data:"
  118.          Height          =   195
  119.          Left            =   180
  120.          TabIndex        =   26
  121.          Top             =   1680
  122.          Width           =   765
  123.       End
  124.       Begin VB.Label Label1 
  125.          Alignment       =   1  'Right Justify
  126.          AutoSize        =   -1  'True
  127.          Caption         =   "Text:"
  128.          Height          =   195
  129.          Left            =   105
  130.          TabIndex        =   24
  131.          Top             =   300
  132.          Width           =   360
  133.       End
  134.       Begin VB.Label Label6 
  135.          Alignment       =   1  'Right Justify
  136.          AutoSize        =   -1  'True
  137.          Caption         =   "Tag:"
  138.          Height          =   195
  139.          Left            =   135
  140.          TabIndex        =   19
  141.          Top             =   990
  142.          Width           =   330
  143.       End
  144.    End
  145.    Begin VB.CommandButton CommandForeColor 
  146.       Caption         =   "Fore Color..."
  147.       Height          =   375
  148.       Left            =   180
  149.       TabIndex        =   6
  150.       Top             =   4740
  151.       Width           =   1305
  152.    End
  153.    Begin VB.CommandButton CommandDrawColor 
  154.       Caption         =   "Draw Color..."
  155.       Height          =   375
  156.       Left            =   180
  157.       TabIndex        =   5
  158.       Top             =   4320
  159.       Width           =   1305
  160.    End
  161.    Begin VB.CommandButton CommandFillColor 
  162.       Caption         =   "Fill Color..."
  163.       Height          =   375
  164.       Left            =   180
  165.       TabIndex        =   4
  166.       Top             =   3900
  167.       Width           =   1305
  168.    End
  169.    Begin VB.ComboBox ComboDrawStyle 
  170.       Height          =   315
  171.       ItemData        =   "itemprop.frx":01C2
  172.       Left            =   1530
  173.       List            =   "itemprop.frx":01DB
  174.       Style           =   2  'Dropdown List
  175.       TabIndex        =   2
  176.       Top             =   2970
  177.       Width           =   2415
  178.    End
  179.    Begin VB.CheckBox CheckHiding 
  180.       Alignment       =   1  'Right Justify
  181.       Caption         =   "Hidden Item"
  182.       Height          =   255
  183.       Left            =   4440
  184.       TabIndex        =   9
  185.       Top             =   2280
  186.       Width           =   1635
  187.    End
  188.    Begin VB.CheckBox CheckTransparent 
  189.       Alignment       =   1  'Right Justify
  190.       Caption         =   "Node Transparent"
  191.       Height          =   255
  192.       Left            =   4440
  193.       TabIndex        =   8
  194.       Top             =   1980
  195.       Width           =   1635
  196.    End
  197.    Begin VB.ComboBox ComboAlignment 
  198.       Height          =   315
  199.       ItemData        =   "itemprop.frx":0241
  200.       Left            =   1530
  201.       List            =   "itemprop.frx":0260
  202.       Style           =   2  'Dropdown List
  203.       TabIndex        =   1
  204.       Top             =   1500
  205.       Width           =   2415
  206.    End
  207.    Begin VB.CommandButton Command2 
  208.       Cancel          =   -1  'True
  209.       Caption         =   "Cancel"
  210.       Height          =   435
  211.       Left            =   5280
  212.       TabIndex        =   14
  213.       Top             =   660
  214.       Width           =   750
  215.    End
  216.    Begin VB.CommandButton Command1 
  217.       Caption         =   "Ok"
  218.       Default         =   -1  'True
  219.       Height          =   435
  220.       Left            =   5280
  221.       TabIndex        =   13
  222.       Top             =   180
  223.       Width           =   750
  224.    End
  225.    Begin VB.ComboBox ComboShape 
  226.       Height          =   315
  227.       ItemData        =   "itemprop.frx":033F
  228.       Left            =   1530
  229.       List            =   "itemprop.frx":035E
  230.       Style           =   2  'Dropdown List
  231.       TabIndex        =   0
  232.       Top             =   1140
  233.       Width           =   2415
  234.    End
  235.    Begin MSComDlg.CommonDialog CommonDialog1 
  236.       Left            =   4290
  237.       Top             =   360
  238.       _Version        =   65536
  239.       _ExtentX        =   847
  240.       _ExtentY        =   847
  241.       _StockProps     =   0
  242.    End
  243.    Begin VB.Label Label4 
  244.       AutoSize        =   -1  'True
  245.       Caption         =   "Origin Arrow:"
  246.       Height          =   195
  247.       Left            =   180
  248.       TabIndex        =   33
  249.       Top             =   1890
  250.       Width           =   900
  251.    End
  252.    Begin VB.Label Label7 
  253.       AutoSize        =   -1  'True
  254.       Caption         =   "Destination Arrow:"
  255.       Height          =   195
  256.       Left            =   180
  257.       TabIndex        =   32
  258.       Top             =   2250
  259.       Width           =   1290
  260.    End
  261.    Begin VB.Label Label10 
  262.       AutoSize        =   -1  'True
  263.       Caption         =   "Link line style:"
  264.       Height          =   195
  265.       Left            =   180
  266.       TabIndex        =   31
  267.       Top             =   2610
  268.       Width           =   990
  269.    End
  270.    Begin VB.Label Label9 
  271.       AutoSize        =   -1  'True
  272.       Caption         =   "DrawWidth:"
  273.       Height          =   195
  274.       Left            =   180
  275.       TabIndex        =   27
  276.       Top             =   3360
  277.       Width           =   840
  278.    End
  279.    Begin VB.Label LabelFont 
  280.       AutoSize        =   -1  'True
  281.       Caption         =   "Test Font"
  282.       Height          =   195
  283.       Left            =   990
  284.       TabIndex        =   25
  285.       Top             =   5250
  286.       Width           =   675
  287.    End
  288.    Begin VB.Label LabelComment 
  289.       BorderStyle     =   1  'Fixed Single
  290.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  291.          Name            =   "MS Sans Serif"
  292.          Size            =   8.25
  293.          Charset         =   0
  294.          Weight          =   700
  295.          Underline       =   0   'False
  296.          Italic          =   0   'False
  297.          Strikethrough   =   0   'False
  298.       EndProperty
  299.       Height          =   795
  300.       Left            =   180
  301.       TabIndex        =   23
  302.       Top             =   180
  303.       Width           =   3765
  304.    End
  305.    Begin VB.Label LabelForeColor 
  306.       BorderStyle     =   1  'Fixed Single
  307.       Height          =   345
  308.       Left            =   1590
  309.       TabIndex        =   22
  310.       Top             =   4740
  311.       Width           =   345
  312.    End
  313.    Begin VB.Label LabelDrawColor 
  314.       BorderStyle     =   1  'Fixed Single
  315.       Height          =   345
  316.       Left            =   1590
  317.       TabIndex        =   21
  318.       Top             =   4320
  319.       Width           =   345
  320.    End
  321.    Begin VB.Label LabelFillColor 
  322.       BorderStyle     =   1  'Fixed Single
  323.       Height          =   345
  324.       Left            =   1590
  325.       TabIndex        =   20
  326.       Top             =   3900
  327.       Width           =   345
  328.    End
  329.    Begin VB.Label Label5 
  330.       AutoSize        =   -1  'True
  331.       Caption         =   "DrawStyle:"
  332.       Height          =   195
  333.       Left            =   180
  334.       TabIndex        =   17
  335.       Top             =   3000
  336.       Width           =   765
  337.    End
  338.    Begin VB.Label Label3 
  339.       AutoSize        =   -1  'True
  340.       Caption         =   "Text Alignment:"
  341.       Height          =   195
  342.       Left            =   180
  343.       TabIndex        =   16
  344.       Top             =   1530
  345.       Width           =   1095
  346.    End
  347.    Begin VB.Label Label2 
  348.       AutoSize        =   -1  'True
  349.       Caption         =   "Node Shape:"
  350.       Height          =   195
  351.       Left            =   180
  352.       TabIndex        =   15
  353.       Top             =   1170
  354.       Width           =   945
  355.    End
  356. Attribute VB_Name = "ItemProp"
  357. Attribute VB_Creatable = False
  358. Attribute VB_Exposed = False
  359. Option Explicit
  360. Private Sub Check1_Click()
  361. End Sub
  362. Private Sub Command1_Click()
  363.   With Main.AddFlow1
  364.     If .SelectedNode Is Nothing And .SelectedLink Is Nothing Then
  365.       ' No current item
  366.       .FillColor = LabelFillColor.BackColor
  367.       .ForeColor = LabelForeColor.BackColor
  368.       .DrawColor = LabelDrawColor.BackColor
  369.       .DrawStyle = ComboDrawStyle.ListIndex
  370.       .DrawWidth = Val(TextDrawWidth)
  371.       .ArrowDst = ComboArrowDst.ListIndex
  372.       .ArrowOrg = ComboArrowOrg.ListIndex
  373.       .LinkStyle = ComboLinkStyle.ListIndex
  374.       .Hidden = (CheckHiding.value = 1)
  375.       .Transparent = (CheckTransparent.value = 1)
  376.       .Shape = ComboShape.ListIndex
  377.       .Alignment = ComboAlignment.ListIndex
  378.       Set .Font = LabelFont.Font
  379.     ElseIf .SelectedLink Is Nothing Then
  380.       ' Current node
  381.       Dim node As afNode
  382.       
  383.       Set node = .SelectedNode
  384.       node.DrawColor = LabelDrawColor.BackColor
  385.       node.ForeColor = LabelForeColor.BackColor
  386.       node.Text = Text1
  387.       node.Tag = Text2
  388.       node.UserData = Val(Text3)
  389.       node.DrawStyle = ComboDrawStyle.ListIndex
  390.       node.DrawWidth = Val(TextDrawWidth)
  391.       node.Hidden = (CheckHiding.value = 1)
  392.       node.Transparent = (CheckTransparent.value = 1)
  393.       node.Marked = (CheckMarked.value = 1)
  394.       node.Shape = ComboShape.ListIndex
  395.       node.Alignment = ComboAlignment.ListIndex
  396.       node.FillColor = LabelFillColor.BackColor
  397.       Set node.Font = LabelFont.Font
  398.     Else
  399.       ' Current Link
  400.       Dim link As afLink
  401.       
  402.       Set link = .SelectedLink
  403.       link.DrawColor = LabelDrawColor.BackColor
  404.       link.ForeColor = LabelForeColor.BackColor
  405.       link.Text = Text1
  406.       link.Tag = Text2
  407.       link.UserData = Val(Text3)
  408.       link.DrawStyle = ComboDrawStyle.ListIndex
  409.       link.LinkStyle = ComboLinkStyle.ListIndex
  410.       link.DrawWidth = Val(TextDrawWidth)
  411.       link.Hidden = (CheckHiding.value = 1)
  412.       link.Rigid = (CheckRigid.value = 1)
  413.       link.Marked = (CheckMarked.value = 1)
  414.       link.ArrowDst = ComboArrowDst.ListIndex
  415.       link.ArrowOrg = ComboArrowOrg.ListIndex
  416.       Set link.Font = LabelFont.Font
  417.     End If
  418.   End With
  419.   Unload Me
  420. End Sub
  421. Private Sub Command2_Click()
  422.   Unload Me
  423. End Sub
  424. Private Sub CommandDrawColor_Click()
  425.   With CommonDialog1
  426.     .Color = LabelDrawColor.BackColor
  427.     .Flags = cdlCCRGBInit
  428.     .Action = 3
  429.     LabelDrawColor.BackColor = .Color
  430.   End With
  431. End Sub
  432. Private Sub CommandFillColor_Click()
  433.   With CommonDialog1
  434.     .Color = LabelFillColor.BackColor
  435.     .Flags = cdlCCRGBInit
  436.     .Action = 3
  437.     LabelFillColor.BackColor = .Color
  438.   End With
  439. End Sub
  440. Private Sub CommandFont_Click()
  441.   With CommonDialog1
  442.     .FontName = LabelFont.Font.Name
  443.     .FontSize = LabelFont.Font.Size
  444.     .FontBold = LabelFont.Font.Bold
  445.     .FontItalic = LabelFont.Font.Italic
  446.     .FontUnderline = LabelFont.Font.Underline
  447.     .FontStrikethru = LabelFont.Font.Strikethrough
  448.     .Flags = cdlCFScreenFonts Or cdlCFEffects
  449.     .ShowFont
  450.     If .CancelError = False Then
  451.       LabelFont.Font.Name = .FontName
  452.       LabelFont.Font.Size = .FontSize
  453.       LabelFont.Font.Bold = .FontBold
  454.       LabelFont.Font.Italic = .FontItalic
  455.       LabelFont.Font.Underline = .FontUnderline
  456.       LabelFont.Font.Strikethrough = .FontStrikethru
  457.     End If
  458.   End With
  459. End Sub
  460. Private Sub CommandForeColor_Click()
  461.   With CommonDialog1
  462.     .Color = LabelForeColor.BackColor
  463.     .Flags = cdlCCRGBInit
  464.     .Action = 3
  465.     LabelForeColor.BackColor = .Color
  466.   End With
  467. End Sub
  468. Private Sub Form_Load()
  469.   Dim f As Font
  470.   With Main.AddFlow1
  471.     If .SelectedNode Is Nothing And .SelectedLink Is Nothing Then
  472.       FrameUserData.Visible = False
  473.       LabelComment.Caption = "No current item: therefore property settings are persistent. Next created items will received those property values by default."
  474.       Text1.Enabled = False
  475.       Text2.Enabled = False
  476.       Text3.Enabled = False
  477.       CheckRigid.Enabled = False
  478.       CheckMarked.Enabled = False
  479.       ComboArrowDst.ListIndex = .ArrowDst
  480.       ComboArrowOrg.ListIndex = .ArrowOrg
  481.       ComboLinkStyle.ListIndex = .LinkStyle
  482.       If .Transparent Then
  483.         CheckTransparent.value = 1
  484.       Else
  485.         CheckTransparent.value = 0
  486.       End If
  487.       ComboShape.ListIndex = .Shape
  488.       ComboAlignment.ListIndex = .Alignment
  489.       LabelFillColor.BackColor = .FillColor
  490.       If .Hidden Then
  491.         CheckHiding.value = 1
  492.       Else
  493.         CheckHiding.value = 0
  494.       End If
  495.       ComboDrawStyle.ListIndex = .DrawStyle
  496.       LabelDrawColor.BackColor = .DrawColor
  497.       LabelForeColor.BackColor = .ForeColor
  498.       TextDrawWidth = Str(.DrawWidth)
  499.       Set f = .Font
  500.     ElseIf .SelectedNode Is Nothing Then
  501.       ' Selected link
  502.       LabelComment.Caption = "The current item is a link. ""Node-only"" properties are disabled. Property settings will apply only to this current link."
  503.       Text1 = .SelectedLink.Text
  504.       Text2 = .SelectedLink.Tag
  505.       Text3 = Str(.SelectedLink.UserData)
  506.       ComboDrawStyle.ListIndex = .SelectedLink.DrawStyle
  507.       TextDrawWidth = Str(.SelectedLink.DrawWidth)
  508.       LabelDrawColor.BackColor = .SelectedLink.DrawColor
  509.       LabelForeColor.BackColor = .SelectedLink.ForeColor
  510.       If .SelectedLink.Hidden Then
  511.         CheckHiding.value = 1
  512.       Else
  513.         CheckHiding.value = 0
  514.       End If
  515.       If .SelectedLink.Rigid Then
  516.         CheckRigid.value = 1
  517.       Else
  518.         CheckRigid.value = 0
  519.       End If
  520.       If .SelectedLink.Marked Then
  521.         CheckMarked.value = 1
  522.       Else
  523.         CheckMarked.value = 0
  524.       End If
  525.       ComboShape.Enabled = False
  526.       ComboAlignment.Enabled = False
  527.       ComboArrowDst.ListIndex = .SelectedLink.ArrowDst
  528.       ComboArrowOrg.ListIndex = .SelectedLink.ArrowOrg
  529.       ComboLinkStyle.ListIndex = .SelectedLink.LinkStyle
  530.       CommandFillColor.Enabled = False
  531.       CheckTransparent.Enabled = False
  532.       Set f = .SelectedLink.Font
  533.     Else
  534.       LabelComment.Caption = "The current item is a node. ""Link-only"" properties are disabled. Property settings will apply only to this current node."
  535.       Text1 = .SelectedNode.Text
  536.       Text2 = .SelectedNode.Tag
  537.       Text3 = Str(.SelectedNode.UserData)
  538.       ComboDrawStyle.ListIndex = .SelectedNode.DrawStyle
  539.       TextDrawWidth = Str(.SelectedNode.DrawWidth)
  540.       LabelDrawColor.BackColor = .SelectedNode.DrawColor
  541.       LabelForeColor.BackColor = .SelectedNode.ForeColor
  542.       If .SelectedNode.Hidden Then
  543.         CheckHiding.value = 1
  544.       Else
  545.         CheckHiding.value = 0
  546.       End If
  547.       If .SelectedNode.Transparent Then
  548.         CheckTransparent.value = 1
  549.       Else
  550.         CheckTransparent.value = 0
  551.       End If
  552.       If .SelectedNode.Marked Then
  553.         CheckMarked.value = 1
  554.       Else
  555.         CheckMarked.value = 0
  556.       End If
  557.       ComboLinkStyle.Enabled = False
  558.       ComboArrowOrg.Enabled = False
  559.       ComboArrowDst.Enabled = False
  560.       ComboShape.ListIndex = .SelectedNode.Shape
  561.       ComboAlignment.ListIndex = .SelectedNode.Alignment
  562.       LabelFillColor.BackColor = .SelectedNode.FillColor
  563.       CheckRigid.Enabled = False
  564.       Set f = .SelectedNode.Font
  565.     End If
  566.       
  567.     ' Item Font
  568.     LabelFont.Font.Name = f.Name
  569.     LabelFont.Font.Size = f.Size
  570.     LabelFont.Font.Bold = f.Bold
  571.     LabelFont.Font.Italic = f.Italic
  572.     LabelFont.Font.Underline = f.Underline
  573.     LabelFont.Font.Strikethrough = f.Strikethrough
  574.   End With
  575. End Sub
  576.